package com.anXin.article.controller;

import com.anXin.article.service.ArticleService;
import com.anXin.model.common.dtos.ResponseResult;
import com.anXin.model.common.enums.AppHttpCodeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/app/article/manager/")
public class ArticleManagerController {
    @Resource
    private ArticleService articleService;


    @GetMapping("delete")
    public ResponseResult deleteArticleById(Long id){
        log.info("管理端开始处理删除业务,参数:{}",id);
        articleService.deleteArticleById(id);
        articleService.removeById(id);
        return ResponseResult.okResult(AppHttpCodeEnum.SUCCESS);
    }
}
